"""
演示for循环的练习题：数一数有几个a
"""

# 统计如下字符串中，有多少个字母a
str = "It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife."

# 定义一个变量，用来统计有多少个a
count = 0

# for 循环统计
# for 临时变量 in 被统计的数据:
for x in str:
    if x == 'a':
        count += 1

print(f"被统计的字符串中有{count}个a")
